<%@ page pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<form method="post" enctype="multipart/form-data" id="addAdmin-form">
	上传头像：<input class="easyui-filebox"  data-options="buttonText:'选择文件',required:true" name="file"/><br/>
  	用户名：<input class="easyui-textbox"  name="username" data-options="required:true" style="width:100px"> <br/>
  	密码：<input id="pwd" class="easyui-textbox"  type="password" name="password" data-options="required:true" style="width:100px"> <br/>
  	<!-- 确认密码：<input id="rpwd" class="easyui-textbox"  type="password" name="password" required="required" validType="equals('#pwd')" style="width:100px"> <br/> -->
   <a id="saveAdmin">确认</a>
   <a id="cancelAdmin">取消</a>
</form>
<script type="text/javascript">
	$("#saveAdmin").linkbutton({    
    	iconCls: 'icon-save',
    	onClick:function(){
    		$('#addAdmin-form').form('submit',{    
			    url:"${pageContext.request.contextPath}/admin/addAdmin",    
			    onSubmit: function(){    
			        return $('#addAdmin-form').form('validate');
			    },    
			    success:function(data){
			        $("#addAdmin").dialog("close");
			    	$.messager.show({
								title:"提示",
								msg:"上传成功!"
							});    
			        $("#admin-tt").datagrid("reload");    
			    }    
			});    
    		
    	}   
	}); 
	$("#cancelAdmin").linkbutton({
			iconCls: 'icon-back',
			onClick:function(){
				$("#addAdmin").dialog("close");
			}
	})
	
</script>